﻿<%@ Page Title="Tours" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Tours.aspx.cs" Inherits="SeccondExampleExam.About" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Tours
        
    </h2>
    
    <asp:ScriptManager runat="server" id="ToursScriptManager"/>    
    <asp:UpdatePanel runat="server" ID="ToursUpdatePanel" UpdateMode="Always">
    <ContentTemplate>
    
    <asp:GridView ID="ToursGrid" runat="server" AutoGenerateColumns="False" 
        DataSourceID="EntityDataSourceTours" AllowPaging="True" AllowSorting="True"
        OnSelectedIndexChanged="SelectedIndexChanged">
        <Columns>
            <asp:BoundField DataField="TourID" HeaderText="TourID" 
                SortExpression="TourID" ReadOnly="True" />
            <asp:BoundField DataField="Destination" HeaderText="Destination" 
                SortExpression="Destination" ReadOnly="True" />
            <asp:BoundField DataField="StartDate" HeaderText="StartDate" 
                SortExpression="StartDate" ReadOnly="True" />
            <asp:BoundField DataField="EndDate" HeaderText="EndDate" 
                SortExpression="EndDate" ReadOnly="True" />
            <asp:BoundField DataField="Price" HeaderText="Price" 
                SortExpression="Price" ReadOnly="True" />
            <asp:CommandField ShowSelectButton="True" />
        </Columns>
    </asp:GridView>
    
    <asp:EntityDataSource ID="EntityDataSourceTours" runat="server" 
        ConnectionString="name=TouristAgencyEntities" 
        DefaultContainerName="TouristAgencyEntities" EnableFlattening="False" 
        EntitySetName="Tours" 
        Select="it.[TourID], it.[StartDate], it.[Destination], it.[EndDate], it.[Price]"
        OrderBy="it.[Destination]" EntityTypeFilter="Tour">
    </asp:EntityDataSource>
    
    <asp:Label ID="MessageLabel" runat="server" Text="Label"></asp:Label>
    
    </ContentTemplate>
    </asp:UpdatePanel>
       
</asp:Content>
